package com.cssnj.portal.domain.func;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;
import java.util.Map;

/**
 * TODO
 *
 * @author Arthur
 * @version 1.0
 * @since 2018/8/17 15:12
 */
@Repository
public interface GlGnRepository extends JpaRepository<GlGnEntity, String> {

    @Modifying
    @Transactional
    @Query("update GlGnEntity T set T.xyBj =:XY_BJ ,T.gnMc=:GN_MC,T.gnjc=:GN_JC where T.gnId = :GN_ID")
    void updateWjj(@Param("GN_ID") String gnid, @Param("GN_MC") String mc, @Param("GN_JC") String jc, @Param("XY_BJ") String zt);

    @Modifying
    @Transactional
    @Query("update GlGnEntity T set T.xyBj =:XY_BJ ,T.gnMc=:GN_MC,T.gnjc=:GN_JC,T.openType=:OPEN_TYPE where T.gnId = :GN_ID")
    void updateCdxx(@Param("GN_ID") String gnid, @Param("GN_MC") String mc, @Param("GN_JC") String jc, @Param("XY_BJ") String zt, @Param("OPEN_TYPE") String dkfs);

    @Modifying
    @Transactional
    @Query("update GlGnEntity T set T.sjgnId=:SJGN_ID where T.gnId = :GN_ID")
    void updatePidById(@Param("GN_ID") String gnid, @Param("SJGN_ID") String pid);

}